<#include "../head_top.ftl">
        <title>
            HTML Compress, Compress HTML online.
        </title>
        <meta name="description" content="Tool for compress HTML online. Remove extra spaces and make it transfer more faster.">
        <meta name="keywords" content="HTML Compress, Compress HTML">
<#include "../head_down.ftl">
    
    <body>
		<#include "/template/common/navigator.ftl">
        <div class="container">
            <div class="row">
                <div class="span10">
                    <div id="listing-post-container">
						<h1>Compress HTML</h1>
						<p></p>
						<p></p>
						<p></p>		
						<p>Tool for compress HTML. Remove extra spaces and make it transfer more faster.</p>
						<p>URL:</p>
						<form method="post" action="html_compress" id="form1">
							<table>
								<tr>
									<td>
										HTML source:
										<select name="requestType" id="requestType" onchange="selectChangeAction()">
											<option value="url"<#if "${requestType!''}"=="url"> selected</#if>>URL</option>
											<option value="content"<#if "${requestType!''}"=="content"> selected</#if>>HTML Content</option>
										</select>
										<input type="button" value="Submit" onclick="doSubmit()"/>
									</td>
								</tr>
								<tr id="urlTr"<#if "${requestType!''}"!="url"> style="display:none"</#if>>
									<td>
										<input type="text" size="94" name="url" id="url" value="${url!''}">
									</td>
								</tr>								
								<tr id="postTr"<#if "${requestType!''}"!="content"> style="display:none"</#if>>
									<td>
										HTML Content:
										<textarea cols="105" rows="15" name="content" id="content">${content!''}</textarea>
									</td>
								</tr>
							</table>
						</form>
						Result:
						<textarea cols="105" rows="15" name="contentResult" readonly="readonly">${contentResult!''}</textarea>
                    </div>
                </div>
                <!--/span10 -->
                <#include "/template/tool/tool_right.ftl">
                <!--/.span4 -->
            </div>
            <!-- /.row -->
        </div>
        <!-- /container -->
		<#include "/template/common/tail.ftl">
    </body>
    <!-- end of body -->
	<script>
		String.prototype.trim=function()
		{
			 return this.replace(/^\s+/g,"").replace(/\s+$/g,"");
		}
		function selectChangeAction(action){
			if(document.getElementById("requestType").value=="url"){
				document.getElementById("urlTr").style.display="";
				document.getElementById("postTr").style.display="none";
			}else{
				document.getElementById("urlTr").style.display="none";
				document.getElementById("postTr").style.display="";
			}
		}
		function doSubmit(action){
			if(document.getElementById("requestType").value=="url"){
				if(document.getElementById("url").value.trim()==""){
					alert("URL is needed.");
					return;
				}
				document.getElementById("form1").submit();
			}else{
				if(document.getElementById("content").value.trim()==""){
					alert("HTML Content is needed.");
					return;
				}
				document.getElementById("form1").submit();
			}	
		}
	</script>
</html>